package com.wang.mall.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedissonConfig {


    /**
     * 所有对redisson的使用都是通过RedissonClient对象实现的
     * @return
     */
    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient() {
        Config config = new Config();

        config.useSingleServer()
                .setPassword("Wd19961224")
                .setAddress("redis://49.234.123.92:9376");
        return Redisson.create(config);
    }
}
